@echo off
setlocal enabledelayedexpansion

set "current_dir=%~dp0"
set "current_dir=%current_dir:~0,-1%"
set "nuke_path=%NUKE_PATH%"

if defined nuke_path (
    echo NUKE_PATH already exists: %nuke_path%
    
    for %%i in (%nuke_path%) do (
        if /i "%%i"=="%current_dir%" (
            echo Directory already in NUKE_PATH, skipping...
            goto :end
        )
    )
    
    setx NUKE_PATH "%current_dir%;%nuke_path%" >nul
    echo Installation successful
) else (
    setx NUKE_PATH "%current_dir%" >nul
    echo Installation successful
)

:end
echo Done.
pause
